<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<link rel="stylesheet" type="text/css"
	href="../../lib/bootstrap/css/bootstrap.css">
<script src="../../lib/jquery.min.js" type="text/javascript"></script>
<script src="../../lib/jquery.cookie.js"></script>
<script src="../../lib/jquery.form.js" type="text/javascript"></script>
<script src="../../lib/bootstrap/js/bootstrap.js"></script>
<script src="../../js/init.js"></script>
<script src="../../lib/bootstrap.file-input.js" type="text/javascript"></script>
<style type="text/css">
html,body {
padding-left: 0px;
width: 100%;
height: 100%;
}



</style>
</head>
<body >
<div style="height: 100%;">



<div style="background-color:dark;width:100%;
				        position:fixed;/*FF IE7 SF*/ 
				        top:0px;
				        bottom:30px;">

	<img id="img_store_log" alt="" src="../../images/none.png" >
	
</div>
<div style="  position:fixed;bottom:0px;">
<form method="post" enctype="multipart/form-data" id="fileUploadForm" name="fileUploadForm"  >
   <input type="file" id='fileinput'  name='file'  title="选择图片" >
   <input type="button" id="clearImg" name="clearImg" title="×"  value="×">
</form>
</div>

   <input type="hidden" id="uploadUrl" value=""/>
</div>


 <script type="text/javascript">

$('#fileinput').bootstrapFileInput();
$('form[name="fileUploadForm"]').ajaxForm();
	
	$('#clearImg').on("click",function(){
		$('#uploadUrl').val("");
		$('#img_store_log').attr("src","../../images/none.png"); 
	});
	
 function submitForm()
 {
	 
    if ($('#fileinput').val() == "") {
		var data = {'code':'400',
					'msg':'先选择图片'};
 		//callback(data);
 		return;
	}

	 
    // submit the form
    $('form[name="fileUploadForm"]').ajaxSubmit({
    	url:api_base_url+"v1/fileUpload",
    	success:function(data){
    		 // data = eval("(" + data + ")");
			if (data.code == '200') {
	    		$('#uploadUrl').val(data.responseData.dburl);
				$('#img_store_log').attr("src",data.responseData.fullUrl); 
			}else{
				alert(data.msg);
			}
    		
    
    	  //if(data.code == '200'){
    	  //	callback(data.responseData);
    	  //}
    	  //	callback(data);
    	}
    });
    // return false to prevent normal browser submit and page navigation
 }
 

  </script>
 	



</body>
</html>